Macromedia Flex Article

Learning Flex Basics (Part 1): Creating Your First Flex Application


Table of Contents

  1. Introduction
  2. A Brief Overview of Macromedia Flex
  3. Building the Application
  4. Create the Application Object
  5. Add a Panel for the Application Layout
  6. Add a Label for the View Header
  7. Add an Array of Objects to Define the Coffee Blends
  8. Add a ComboBox to Display the Coffee Blends
  9. Add a Text Control to Display the Description
  10. Add a Button to Add a Coffee Blend to the Shopping Cart
  11. Add a List Control for the Shopping Cart
  12. Add a Script to Handle the Button Click Event
  13. Complete Code Listing for firstapp.mxml
  14. Where to Go From Here

Create the Application Object

To begin any Flex application, start with an XML declaration and an Application block. The Application tag will include a namespace declaration for the MX class library: xmlns:mx="http://www.macromedia.com/2003/mxml". The mx prefix is used with all tags for this library.

  1. Create a new file and save it as firstapp.mxml in the flex_tutorials directory.
  2. At the beginning of the file, insert the XML declaration:
    <?xml version="1.0">
    
  3. After the XML declaration, add an Application tag with the MXML namespace:

    <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
    </mx:Application>